<template>
	<view class="menu-body">
	<template>
		<view>
			<text>版本</text>
			{{versionName}}
		</view>
		<view  class="menu">
			<view class="title">采购管理</view>
			<view class="menu-list">
				<view class="menu-item" @click="skipPurIn">
					<i class="iconfont icon-cgrk" style="background: #4ad553;" />采购入库单
				</view>
				<view class="menu-item" @click="skipReceive">
					<i class="iconfont icon-renwu" style="background: #59d973;" />收料通知单
				</view>
				<view class="menu-item" @click="skipPurReturn">
					<i class="iconfont icon-tui" style="background: #aaaa00;" />采购退料单
				</view>
			</view>
		</view>
		<view  class="menu">
			<view class="title">生产管理</view>
			<view class="menu-list">
				<view class="menu-item" @click="skipPrdPick">
					<i class="iconfont icon-shengchanlingliao" style="background: #d96b32;" />生产领料单
				</view>
				<view class="menu-item" @click="skipPrdInList">
					<i class="iconfont icon-cgrk" style="background: #d96b32;" />生产入库单
				</view>
				<view class="menu-item" @click="skipPrdFeed">
					<i class="iconfont icon-daqiabuqiandan" style="background: #d96b32;" />生产补料单
				</view>
				<view class="menu-item" @click="skipPrdReturn">
					<i class="iconfont icon-renwu" style="background: #59d973;" />生产退料单
				</view>
				
				<view class="menu-item" @click="skipProPlanList">
					<i class="iconfont icon-renwu" style="background: #59d973;" />工序汇报单
				</view>
			
				<view class="menu-item" @click="skipTransferList">
					<i class="iconfont icon-tiaoboruku" style="background: #59d973;" />调拨单
				</view>
				<view class="menu-item" @click="skipTrayList">
					<i class="iconfont icon-tiaoboruku" style="background: #59d973;" />托盘列表
				</view>
				<view class="menu-item" @click="skipjijia">
					<i class="iconfont icon-tiaoboruku" style="background: #59d973;" />机加打印
				</view>
				<view class="menu-item" @click="skipTrayOpt">
					<i class="iconfont icon-tiaoboruku" style="background: #59d973;" />汇报查询
				</view>
			</view>
		</view>
		<view  class="menu">
			<view class="title">质检管理</view>
			
			<view class="menu-list">
				<view class="menu-item" @click="skipProPlaninspecList">
					<i class="iconfont icon-jianhuo" style="background: #4ad553;" />工序巡检单
				</view>
				<view class="menu-item" @click="skipInspect">
					<i class="iconfont icon-cgrk" style="background: #4ad553;" />采购质检
				</view>
				<view class="menu-item" @click="skipPrdInspect">
					<i class="iconfont icon-cgrk" style="background: #4ad553;" />生产入库质检
				</view>
				<view class="menu-item" @click="skipOtherInspect">
					<i class="iconfont icon-cgrk" style="background: #4ad553;" />其他质检
				</view>
				
			</view>
		</view>
		<view  class="menu">
			<view class="title">模具管理</view>
			<view class="menu-list">
				<view class="menu-item" @click="skipMoldPick">
					<i class="iconfont icon-other-out" style="background: #4ad553;" />领用模具
				</view>
				<view class="menu-item" @click="skipMoldReturn">
					<i class="iconfont icon-other-entry" style="background: #4ad553;" />归还模具
				</view>
				<view class="menu-item" @click="skipMoldInspect">
					<i class="iconfont icon-other-entry" style="background: #4ad553;" />模具检查单
				</view>
				<view class="menu-item" @click="skipMoldMain">
					<i class="iconfont icon-other-entry" style="background: #4ad553;" />模具维修单
				</view>
			</view>
			
		</view>
		<view  class="menu">
			<view class="title">其他管理</view>
			<view class="menu-list">
				<view class="menu-item" @click="skipOtherOut">
					<i class="iconfont icon-other-out" style="background: #4ad553;" />其他出库申请
				</view>
				<view class="menu-item" @click="skipOtherIn">
					<i class="iconfont icon-other-entry" style="background: #4ad553;" />其他入库
				</view>
				<view class="menu-item" @click="skipTransferApp">
					<i class="iconfont icon-other-entry" style="background: #4ad553;" />调拨申请
				</view>
				<view class="menu-item" @click="stockInquire">
					<i class="iconfont icon-other-entry" style="background: #4ad553;" />库存查询
				</view>
			</view>
			
		</view>
		<!-- 扫描托盘 -->
		<tray-popup ref="trayPopupRef" @success="trayScanningScuess"></tray-popup>
	</template>
	
	<!--  操作面板  -->
	<min-action-sheet ref="as"></min-action-sheet>
	</view>
</template>

<script>
	
	import minActionSheet from '@/components/min-action-sheet/min-action-sheet'
	import {getUserInfo} from '@/utils/api.js';
	import trayPopup from '../../components/popup/trayPopup.vue'
	export default {
		data() {
			return {
				
				indicatorStyle: `height: 50px;`,
				versionName :''
				
			};
		},
		
		onShow() {
			
		},
		
		components: {
			minActionSheet,
			trayPopup
		
		},
		methods: {
			//扫描成功后跳转到汇报查询界面
			trayScanningScuess(e){
				uni.navigateTo({
					url:'/pages/quality/trayOptList?billNo=' + e,
					success: () => {
					   },
					   fail: (err) => {
					   }
				})
			},
			
			/**
			 * 跳转生产入库单
			 */
			skipPrdInList(){
				uni.navigateTo({
					url:'/pages/produce/proInList',
					success: () => {
					   },
					   fail: (err) => {
					   }
				})
			},
			
			/**
			 * 托盘汇报查询
			 */
			skipTrayOpt(){
				/**
				 * 扫码
				 */
				this.$refs.trayPopupRef.open()
				// uni.navigateTo({
				// 	url:'/pages/quality/trayOptList',
				// 	success: () => {
				// 	   },
				// 	   fail: (err) => {
				// 	   }
				// })
			},
			/**
			 * 跳转到机加打印列表
			 */
			skipjijia(){
				uni.navigateTo({
					url:'/pages/produce/projijiaPrint',
					success: () => {
					   },
					   fail: (err) => {
					   }
				})
			},
			/**
			 * 跳转到托盘列表
			 */
			skipTrayList(){
				uni.navigateTo({
					url:'/pages/produce/trayList',
					success: () => {
					   },
					   fail: (err) => {
					   }
				})
			},
			/**
			 * 跳转到调拨单
			 */
			skipTransferList(){
				uni.navigateTo({
					url:'/pages/storehouse/transferSource',
					success: () => {
					   },
					   fail: (err) => {
					   }
				})
			},
			/**
			 * 跳转工序汇报单
			 */
			skipProPlanList(){
				uni.navigateTo({
					url:'/pages/produce/proplanList',
					success: () => {
					   },
					   fail: (err) => {
					   }
				})
			},
			/**
			 * 跳转工序巡检单
			 */
			skipProPlaninspecList(){
				uni.navigateTo({
					url:'/pages/produce/proplaninspecList',
					success: () => {
					   },
					   fail: (err) => {
					   }
				})
			},
			/**
			 * 模具维修单
			 */
			skipMoldMain(){
				uni.navigateTo({
					url:'/pages/mold/moldMainList',
					success: () => {
					   },
					   fail: (err) => {
					   }
				})
			},
			/**
			 * 模具检查单
			 */
			skipMoldInspect(){
				uni.navigateTo({
					url:'/pages/mold/moldInpectList',
					success: () => {
					   },
					   fail: (err) => {
					   }
				})
			},
			/**
			 * 跳转到模具归还(工序计划列表)
			 */
			skipMoldReturn(){
				uni.navigateTo({
					url:'/pages/mold/moldReturnList',
					success: () => {
					   },
					   fail: (err) => {
					   }
				})
			},
			/**
			 * 跳转到模具领用(工序计划列表)
			 */
			skipMoldPick(){
				uni.navigateTo({
					url:'/pages/mold/moldPick',
					success: () => {
					   },
					   fail: (err) => {
					   }
				})
			},
			/**
			 * 跳转到其他出库
			 */
			skipOtherOut(){
				uni.navigateTo({
					url:'/pages/other/otherOutList',
					success: () => {
					   },
					   fail: (err) => {
					   }
				})
			},
			/**
			 * 跳转到调拨申请
			 */
			skipTransferApp(){
				uni.navigateTo({
					url:'/pages/other/stkTransferApp',
					success: () => {
					   },
					   fail: (err) => {
					   }
				})
			},
			/**
			 * 跳转到其他入库
			 */
			skipOtherIn(){
				uni.navigateTo({
					url:'/pages/storehouse/uuidDemo',
					success: () => {
					   },
					   fail: (err) => {
					   }
				})
			},
			/**
			 * 跳转到库存查询
			 */
			stockInquire(){
				uni.navigateTo({
					url:'/pages/Stock/StockInquire',
					success: () => {
					   },
					   fail: (err) => {
					   }
				})
			},
			skipPurIn(){		
				uni.navigateTo({
					url:'/pages/purchase/purInList',
					success: () => {
					   },
					   fail: (err) => {
					   }
				})
			},
			skipReceive(){
				
				uni.navigateTo({
					url:'/pages/purchase/receiveList',
					success: () => {
					   
				   },
				   fail: (err) => {
					  
				   }
				})
			},
			//跳转到采购退料单
			skipPurReturn(){
				uni.navigateTo({
					url:'/pages/purchase/purReturnList',
					success: () => {
				   },
				   fail: (err) => {
					  
				   }
				})
			},
			//跳转到生产补料单
			skipPrdFeed(){
				uni.navigateTo({
					url:'/pages/produce/prdFeedList',
					success: () => {
				   },
				   fail: (err) => {
					  
				   }
				})
			},
			//跳转到生产退料单
			skipPrdReturn(){
				uni.navigateTo({
					url:'/pages/produce/prdReturnList',
					success: () => {
				   },
				   fail: (err) => {
					  
				   }
				})
			},
			//跳转到生产领料单
			skipPrdPick(){
				uni.navigateTo({
					url:'/pages/produce/prdPickList',
					success: () => {
				   },
				   fail: (err) => {
					  
				   }
				})
			},
			//跳转到生产入库质检
			skipPrdInspect(){
				uni.navigateTo({
					url:'/pages/quality/prdInspectList',
					success: () => {
					 
				   },
				   fail: (err) => {
					   
				   }
				})
			},
			//跳转到其他入库质检
			skipOtherInspect(){
				uni.navigateTo({
					url:'/pages/quality/otherInspectList',
					success: () => {
					 
				   },
				   fail: (err) => {
					   
				   }
				})
			},
			//跳转到采购质检
			skipInspect(){
				uni.navigateTo({
					url:'/pages/quality/inspectList',
					success: () => {
					 
				   },
				   fail: (err) => {
					   
				   }
				})
			},
			
			/**
			 * 顶部按钮事件
			 * @param {Object} e
			 */
			onNavigationBarButtonTap(e) {
				
				this.$refs.as.handleShow({
					actions: [{
						name: '退出登录',
					}, ],
					success: (res) => {
						switch (res.id) {
							// -1代表取消按钮
							case -1:
								break
							case 0:
								uni.navigateTo({
									url:'/pages/login/login'
								})
								break
						}
					}
				})
			},
			
			getUserInfo(){
				getUserInfo({}).then(res => {
					
					if (res.data.status == 200){
					
					} else{
						this.window.location()
					}
					
					
				}
				)
			}
	},
	onLoad() {
	
		this.getUserInfo()
		console.log(plus.runtime.versionCode)
		 // #ifdef APP-PLUS
		  this.versionName = plus.runtime.version
		  // #endif
		
		  // #ifndef APP-PLUS
		  this.versionName = 'vH5调试模式'
		  // #endif
	},
	mounted() {
		//this.getUserInfo()
	},
	beforeMount() {
		
	}
}
</script>

<style lang="scss" scoped>
	.selectPopup-panel{
		background-color: #fff;
	   width: 250px;
	   height: 100px;
	   
	 //   .selectPopup-panel-top{
		// position: relative;
		// background-color: #fff;
		// height: 30%;
		
		// text-align: center;
		// .selectPopup-panel-top-title{
		// 	text-align: center;
		// 	font-size: 18px;
		// }
	 //   }
	   .selectPopup-panel-close{
		position: absolute;
		top: 0px;
		right: 0rpx;
	   }
	}
	.menu-body {
		.menu {
			background-color: white;
			border-bottom: 10px solid #f8f8f8;
	
			.title {
				height: 40px;
				font-weight: 600;
				line-height: 40px;
				font-size: 20px;
				padding: 0 10px;
				border-bottom: 1px solid #f8f8f8;
			}
	
			.menu-list {
				display: flex;
				flex-wrap: wrap;
				justify-content: space-between;
				padding: 15px px;
	
				.menu-item {
					display: flex;
					align-items: center;
					justify-content: center;
					width: calc(50% - 1px);
					height: 80px;
					background-color: white;
					border-radius: 8px;
					box-shadow: 0px 4px 10px 0px rgba(202, 202, 202, 0.3);
					box-sizing: border-box;
					border: 1px solid rgba(255, 78, 116, .2);
					font-size: 22px;
	
					&:nth-child(n + 3) {
						margin-top: 20px;
					}
	
					.iconfont {
						margin-right: 8px;
						font-size: 18px;
						background: #1cd1bc;
						color: white;
						border-radius: 4px;
						padding: 3px;
					}
				}
			}
		}
	}
</style>
